#include <stdio.h>
#include <math.h>
#include <stdlib.h>

#define ALLOCA(Type) (Type *)malloc(sizeof(Type))

typedef union
{
  char *op;
  int num;
}TreeNode;

typedef struct tree
{
  TreeNode node;
  struct tree *right;
  struct tree *left;
}Tree;

Tree *AllocateTree()
{
  Tree *p = ALLOCA(Tree);
  if(p == NULL) 
    {
      printf("Allocate Tree Node fail!!!");
      exit(1);
    }
  return p;
}

void BuildTree(Tree *tree)
{
  Tree *leftNode = AllocateTree();
  Tree *rightNode =  AllocateTree();
  leftNode -> node.num = 1;
  rightNode -> node.num = 2;

  tree -> node.op = '+'; 
  tree -> left = leftNode;
  tree -> right = rightNode; 
    
}

void Calc(Tree *tree)
{
  
}

int main(int argc,char **argv)
{
  Tree *tree = AllocateTree();
  
  BuildTree(tree);

  Calc(tree);
  
  return 0;
}
